﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="System.Collections.Generic" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	磷石膏堆积坝（每日）
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <%
        DateTime date = (DateTime)ViewData["date"];
    %>
    <div class="screen_area">
        <form method="Get" action="/Query/Ditch">
        <div>
        <%if ((bool)ViewData["showFactory"])
            {%>
        请选择公司：<%= Html.DropDownList("factoryId", ViewData["factories"] as List<SelectListItem>, "请选择公司", new { onchange = "showStacks();" })%>
        <span style="margin-left:20px"></span>
        <%
            }
            else
            {
        %>
        <%=Html.Hidden("factoryId", ViewData["factoryId"]) %>
        <%
            }
        %>
        <label>请选择堆场/尾矿库：</label><span id="stackList"><%= Html.DropDownList("stackId", ViewData["stacksAndTailingponds"] as List<SelectListItem>, "请选择")%></span>
        <span style="margin-left:20px"></span>
        <label>查询日期：</label><span><input type="text" name="date" id="date" size="12" value="<%=date.Year %>-<%=date.Month %>-<%=date.Day %>" class="ipt_date" readonly="readonly" /></span>
        <span><input type="submit" value="查  询" /></span>
        </div>
        </form>
    </div>
    <div style="margin-top:10px;margin-bottom:10px"></div>
    <div id="dolphincontainer">
	    <div id="dolphinnav">
	        <ul class="top_tab">
                <li><a href="/Query/StackWater?stackId=<%=ViewData["stackId"]%>&date=<%=(DateTime)ViewData["date"]%>&factoryId=<%=ViewData["factoryId"] %>"><span>水位及水质</span></a></li>
                <li><a href="/Query/BackWater?stackId=<%=ViewData["stackId"]%>&date=<%=(DateTime)ViewData["date"]%>&factoryId=<%=ViewData["factoryId"] %>"><span>进浆及回水</span></a></li>
                <li><a href="/Query/Settle?stackId=<%=ViewData["stackId"]%>&date=<%=(DateTime)ViewData["date"]%>&factoryId=<%=ViewData["factoryId"] %>"><span>沉降及位移</span></a></li>
                <li><a href="/Query/Ardealite?stackId=<%=ViewData["stackId"]%>&date=<%=(DateTime)ViewData["date"]%>&factoryId=<%=ViewData["factoryId"] %>"><span>磷石膏堆积坝</span></a></li>
                <li><a href="javascript:return(false);" class="current"><span>截洪沟</span></a></li>
                <li><a href="/Query/PiezometerWell?stackId=<%=ViewData["stackId"]%>&date=<%=(DateTime)ViewData["date"]%>&factoryId=<%=ViewData["factoryId"] %>"><span>浸润线观测</span></a></li>
                <li><a href="/Query/PiezometerBase?stackId=<%=ViewData["stackId"]%>&date=<%=(DateTime)ViewData["date"]%>&factoryId=<%=ViewData["factoryId"] %>"><span>渗压观测</span></a></li>
                <li><a href="/Query/Drain?stackId=<%=ViewData["stackId"]%>&date=<%=(DateTime)ViewData["date"]%>&factoryId=<%=ViewData["factoryId"] %>"><span>导渗系统</span></a></li>
	        </ul>
	    </div>
	</div>

    <%
        string[] positions = new string[] { "", "东", "东南", "南", "西南", "西", "西北", "北", "东北" };
        string ditchDesignPic = (string)ViewData["ditchDesignPic"];
        List<Runoff_Interception_Ditch_Base_Info> ditches = (List<Runoff_Interception_Ditch_Base_Info>)ViewData["ditchs"];
    %>

    <% 
        
        DateTime preDate = date.AddDays(-1);
        DateTime nextDate = date.AddDays(1);
    %>

    <div class="dataarea">
        <a class="arrow_l" href="/Query/Ditch?stackId=<%=ViewData["stackId"]%>&date=<%=preDate%>&factoryId=<%=ViewData["factoryId"] %>" title="前一日">前一日</a>
        <strong><%= date.Year%>年<%=date.Month%>月<%=date.Day%>日</strong><%if (date.Date < DateTime.Now.Date) { %>
        <a class="arrow_r" href="/Query/Ditch?stackId=<%=ViewData["stackId"]%>&date=<%=nextDate%>&factoryId=<%=ViewData["factoryId"] %>" title="后一日">后一日</a><%} %>
    </div>
    
    <table cellpadding="4" cellspacing="0" class="com_from_table" style="width:756px;">

        <tr>
            <td class="lab" style="width:158px;">测量人员：</td>
            <td>
                <%
                    User tester = (User) ViewData["tester"];
                    if (tester != null)
                    {
                %>
                <%=tester.RealName + " (" + tester.Name + ")"%>
                <%
                    }
                %>&nbsp;&nbsp;
            </td>
        </tr>

    </table>
    
    
    <%foreach (Runoff_Interception_Ditch_Base_Info ditch in ditches) { %>
        
        <%
            Runoff_Interception_Ditch_daily_info ditchRecord = (Runoff_Interception_Ditch_daily_info)ViewData["dailyDitch" + ditch.ditch_no];
        %>
        

        <table cellpadding="4" cellspacing="0" class="com_from_table3" style="width:756px;">
            <tr>
                <th colspan="2">[<%=(ditch.position.HasValue ? positions[ditch.position.Value] : "")%>] [<%=(ditch.El.HasValue ? ditch.El.Value.ToString() : "")%>]米 高程截洪沟</th>
            </tr>
            <tr>
                <td style="width:240px;">
                    <label class="long">侧壁或底部是否有裂纹产生：</label>
                    <span style="padding-left:1em;"><%if (ditchRecord.is_Sidewall_Crack == 1){ %><span style="color:Red;">有</span><%}else if (ditchRecord.is_Sidewall_Crack == 0){ %>无<%} %></span>
                </td>
                <td>
                    <p><%= ditchRecord.Sidewall_Crack_description%></p>
                </td>
            </tr>
            <tr>
                <td>
                    <label class="long">截洪沟内是否发生淤堵：</label>
                    <span style="padding-left:1em;"><%if (ditchRecord.is_Clogging == 1){ %><span style="color:Red;">有</span><%}else if(ditchRecord.is_Clogging == 0){ %>无<%} %></span>
                </td>
                <td>
                    <p><%= ditchRecord.Clogging_description%></p>
                </td>
            </tr>
            <tr>
                <td>
                    <label class="long">外侧边坡是否有失稳迹象：</label>
                    <span style="padding-left:1em;"><%if (ditchRecord.is_Instability == 1){ %><span style="color:Red;">有</span><%}else if (ditchRecord.is_Instability == 0){ %>无<%} %></span>
                </td>
                <td>
                    <p><%= ditchRecord.Instability_description%></p>
                </td>
            </tr>
            <tr>
                <td>
                    <label class="long">内侧道路是否出现裂纹：</label>
                    <span style="padding-left:1em;"><%if (ditchRecord.is_Innerwall_Crack == 1){ %><span style="color:Red;">有</span><%}else if (ditchRecord.is_Innerwall_Crack == 0){ %>无<%} %></span>
                </td>
                <td>
                    <p><%= ditchRecord.Innerwall_Crack_description%></p>
                </td>
            </tr>
        </table>
        
        
        <%} %>
        
    <script type="text/javascript" language="javascript">
        $('#date').datepicker({ changeMonth: true, changeYear: true });

        function showStacks() {
            var factoryId = document.getElementById("factoryId").value;
            if (factoryId == "" || factoryId == 0) return;
            $.ajax({ 
                    type: "POST",
                    url: "<%=Url.Content("~/Modification/ListStacks") %>",
                    data: "factoryId=" + factoryId,
                    success: function (data) { $("#stackList").html(data);}
            });
        }
    </script>
</asp:Content>
